Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jasmine

Package Overview
Dependencies
Maintainers
3
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jasmine

Command line jasmine

  • 2.99.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3M
decreased by-22.87%
Maintainers
3
Weekly downloads
 
Created

What is jasmine?

Jasmine is a behavior-driven development framework for testing JavaScript code. It does not rely on any other JavaScript frameworks and does not require a DOM. Jasmine is designed to be easy to configure and provides features to write different types of tests for JavaScript applications.

What are jasmine's main functionalities?

Writing Specs

This feature allows you to write test cases (specs) within a suite. A suite begins with a call to the global Jasmine function 'describe' with two parameters: the title of the suite and a function containing one or more specs.

describe('A suite', function() {\n  it('contains spec with an expectation', function() {\n    expect(true).toBe(true);\n  });\n});

Setup and Teardown

This feature allows you to define code that will run before and after each spec in a suite. 'beforeEach' and 'afterEach' are used to set up preconditions and clean up after your specs.

describe('A suite', function() {\n  beforeEach(function() {\n    // Code to execute before each spec in this suite\n  });\n  afterEach(function() {\n    // Code to execute after each spec in this suite\n  });\n});

Asynchronous Support

This feature supports asynchronous tests, which are crucial for handling AJAX, timeouts, or any operations that rely on external systems. The 'done' callback is used to tell Jasmine when the asynchronous function has completed.

describe('Async spec', function() {\n  it('supports async execution of test preparation and expectations', function(done) {\n    setTimeout(function() {\n      expect(true).toBe(true);\n      done();\n    }, 1000);\n  });\n});

Other packages similar to jasmine

Keywords

FAQs

Package last updated on 06 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc